package com.nulstudio.cloud.supplier.mapper;

import com.nulstudio.cloud.common.domain.vo.SupplierVo;
import com.nulstudio.cloud.common.entity.NulSupplier;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface SupplierMapper {
    @NonNull
    List<NulSupplier> fetchAll(@Param("name") @NonNull String name);

    @Nullable
    SupplierVo findSupplierById(@Param("id") int id);

    int insert(@Param("supplier") @NonNull NulSupplier supplier);

    int update(@Param("supplier") @NonNull NulSupplier supplier);

    int delete(@Param("suppliers") @NonNull List<Integer> suppliers);

    boolean checkExistenceById(@Param("id") int id);
}
